<template>
    <div id="app">
        <el-row :gutter="2">
            <el-col :span="2"><img src="./assets/company_icon.png" alt="公司图标"/></el-col>
            <el-col :span="2">
                <div id="job-name" style="font-size: larger;font-weight: bolder">
                    <span>JAVA开发工程师</span>
                    <br/>
                    <span style="color: #cc121d">20K-30K</span>
                </div>
            </el-col>
        </el-row>
        <el-row style="margin-bottom: 20px">
            <el-col :span="6" style="text-align: left">
                <div style="font-size: larger;font-weight: bolder"><span>职位要求</span></div>
                <span style="width: 250px">上海 经验1-3年 本科及以上 全职</span>
            </el-col>
        </el-row>
        <el-row style="margin-bottom: 20px">
            <el-col :span="6" style="text-align: left">
                <div style="font-size: larger;font-weight: bolder"><span>福利</span></div>
                <span style="width: 100px">美女 帅哥 995 20薪</span>
            </el-col>
        </el-row>
        <el-row style="margin-bottom: 20px; text-align: left">
            <el-col :span="2" style="margin-left: 0">
                <el-button @click="vieCompany('job_code')">浏览公司</el-button>
            </el-col>
            <el-col :span="2" style="border-left: 2px">
                <el-button @click="collectCompany('job_code')">收藏职位</el-button>
            </el-col>
            <el-col :span="2">
                <el-button @click="deliveryResume('job_code')">投递简历</el-button>
            </el-col>
            <el-col :span="2">
                <el-button @click="uploadResume('job_code')">上传简历</el-button>
            </el-col>
        </el-row>
    </div>
</template>

<script>
    import axios from "axios";

    const userId = Math.round(Math.random() * 1000);
    export default {
        methods: {
            vieCompany(companyId) {
                axios.post("/job/log", {
                    "user_id": userId,
                    "job_code": companyId,
                    "action": 'click',
                    "act_time": new Date()
                })
            },

            collectCompany(companyId) {
                axios.post("/job/log", {
                    "user_id": userId,
                    "job_code": companyId,
                    "action": 'job_collect',
                    "act_time":new Date()
                })
            },
            deliveryResume(companyId) {
                axios.post("/job/log", {
                    "user_id": userId,
                    "job_code": companyId,
                    "action": 'cv_send',
                    "act_time":new Date()
                })
            },

            uploadResume(companyId) {
                axios.post("/job/log", {
                    "user_id": userId,
                    "job_code": companyId,
                    "action": 'cv_upload',
                    "act_time":new Date()
                })
            }
        }
    }
</script>

<style>
    #app {
        font-family: Helvetica, sans-serif;
        text-align: center;
    }
</style>
